


// int main()
// {
//     //openSaveMode();
//     // LogMassage(__FILE__, __LINE__, DEBUG, "DEBUG: %d", 1);
//     // LOG(DEBUG, "DEBUG: %d", 1);
//     srand(time(nullptr));
//     int cnt = 10;
//     while (cnt--)
//     {
//         int x = rand() % 100 + 1;
//         int y = rand() % 100 + 1;

//     }
//     return 0;
// }
#include "threadpool.hpp"
#define THREAD_NUM 3

int main()
{
    //openSaveMode();

    ThreadPool<Task> threadpool(THREAD_NUM);

    threadpool.threadInit();
    threadpool.threadStart();

    srand(time(nullptr));
    int cnt = 5;
    while (cnt--)
    {
        int x = rand() % 100 + 1;
        int y = rand() % 100 + 1;

        Task task(x, y);
        task.question();

        LOG(INFO, "main enQueue");

        threadpool.enQueue(task);

        sleep(2);
    }

    threadpool.Stop();

    threadpool.threadWait();

    return 0;
}